package net.dao;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.NotImplementedException;

public class SQLFunctionUtils {

	public static final String START_TAG = "__#{";

	public static final String END_TAG = "}#__";

	static public String concatFunction(String[] strs, IDataAccessInterface<?, ?> jdbcDAO) {
		StringBuffer function = new StringBuffer();
		if (SQLBuilder.MYSQL.equalsIgnoreCase(jdbcDAO.getDatabaseType())) {
			function.append("CONCAT(").append(StringUtils.join(strs, ",")).append(")");
		} else if ((SQLBuilder.MSSQLSERVER.equalsIgnoreCase(jdbcDAO.getDatabaseType()))) {

			throw new NotImplementedException("SQL Server Not Impl");

		} else if ((SQLBuilder.ORACLE.equalsIgnoreCase(jdbcDAO.getDatabaseType()))) {
			throw new NotImplementedException("SQL Server Not Impl");
		}

		return function.toString();
	}
}
